package com.duowei.diandan.db.entry;

import android.arch.persistence.room.Entity;
import android.arch.persistence.room.PrimaryKey;

/**
 * 经营场所设置(桌子)
 */
@Entity
public class Jycssz {
    @PrimaryKey(autoGenerate = true)
    private long id;

    private String csbh;
    private String csmc;
    private String fcsbh;
    private Float zdxfje;
    private Float fwjcf;
    private String jcsj;
    private String bm;
    private String mc;
    private String dyjmc;
    private String czlxbm;
    private Integer jcrs;
    private String sfwx;

    public Jycssz() {
    }

    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    public String getCsbh() {
        return csbh;
    }

    public void setCsbh(String csbh) {
        this.csbh = csbh;
    }

    public String getCsmc() {
        return csmc;
    }

    public void setCsmc(String csmc) {
        this.csmc = csmc;
    }

    public String getFcsbh() {
        return fcsbh;
    }

    public void setFcsbh(String fcsbh) {
        this.fcsbh = fcsbh;
    }



    public Float getZdxfje() {
        return zdxfje;
    }

    public void setZdxfje(Float zdxfje) {
        this.zdxfje = zdxfje;
    }

    public Float getFwjcf() {
        return fwjcf;
    }

    public void setFwjcf(Float fwjcf) {
        this.fwjcf = fwjcf;
    }

    public String getJcsj() {
        return jcsj;
    }

    public void setJcsj(String jcsj) {
        this.jcsj = jcsj;
    }

    public String getBm() {
        return bm;
    }

    public void setBm(String bm) {
        this.bm = bm;
    }

    public String getMc() {
        return mc;
    }

    public void setMc(String mc) {
        this.mc = mc;
    }

    public String getDyjmc() {
        return dyjmc;
    }

    public void setDyjmc(String dyjmc) {
        this.dyjmc = dyjmc;
    }

    public String getCzlxbm() {
        return czlxbm;
    }

    public void setCzlxbm(String czlxbm) {
        this.czlxbm = czlxbm;
    }

    public Integer getJcrs() {
        return jcrs;
    }

    public void setJcrs(Integer jcrs) {
        this.jcrs = jcrs;
    }

    public String getSfwx() {
        return sfwx;
    }

    public void setSfwx(String sfwx) {
        this.sfwx = sfwx;
    }

    public static String querySql() {
        return "SELECT csbh, fcsbh, csmc, zdxfje, fwjcf, jcsj, bm, mc, dyjmc, czlxbm, jcrs, sfwx " +
                "FROM jycssz|";
    }

//    @Override
//    public boolean equals(Object obj) {
//        if (obj != null && obj instanceof Jycssz) {
//            Jycssz j = (Jycssz) obj;
//
//            return Objects.equals(this.csbh, j.csbh)
//                    && Objects.equals(this.csmc, j.csmc)
//                    && this.isUsed == j.isUsed;
//
//        } else {
//            return super.equals(obj);
//        }
//    }

//    public static String querySql() {
//        return "SELECT csbh, csmc, 0 AS isUsed " +
//                "FROM JYCSSZ " +
//                "WHERE ISNULL(FCSBH, '') <> '' " +
//                "      AND csbh NOT IN (SELECT a.csbh " +
//                "                       FROM jycssz a, wmlsbjb b " +
//                "                       WHERE " +
//                "                         (((charindex('@' + a.csmc + ',', '@' + b.zh) > 0) OR (charindex(',' + a.csmc + ',', b.zh) > 0)) " +
//                "                          AND b.sfyjz <> '1' AND " +
//                "                          b.wmdbh IN (SELECT DISTINCT wmlsb.wmdbh " +
//                "                                      FROM wmlsb)) OR " +
//                "                         (((charindex('@' + a.csmc + ',', '@' + b.zh) > 0) OR (charindex(',' + a.csmc + ',', b.zh) > 0)) " +
//                "                          AND " +
//                "                          b.wmdbh IN (SELECT DISTINCT wmdbh " +
//                "                                      FROM JCZTB))) " +
//                "UNION " +
//                "SELECT csbh, csmc, 1 AS isUsed " +
//                "FROM JYCSSZ " +
//                "WHERE ISNULL(FCSBH, '') <> '' " +
//                "      AND csbh IN (SELECT a.csbh " +
//                "                   FROM jycssz a, wmlsbjb b " +
//                "                   WHERE " +
//                "                     (((charindex('@' + a.csmc + ',', '@' + b.zh) > 0) OR (charindex(',' + a.csmc + ',', b.zh) > 0)) " +
//                "                      AND b.sfyjz <> '1' AND " +
//                "                      b.wmdbh IN (SELECT DISTINCT wmlsb.wmdbh " +
//                "                                  FROM wmlsb)) OR " +
//                "                     (((charindex('@' + a.csmc + ',', '@' + b.zh) > 0) OR (charindex(',' + a.csmc + ',', b.zh) > 0)) " +
//                "                      AND " +
//                "                      b.wmdbh IN (SELECT DISTINCT wmdbh " +
//                "                                  FROM JCZTB)))|";
//    }
}
